Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pcli migrate balance: replicate account structure #4848

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

cronokirby
Copy link
Contributor

This changes the migrate balance command to replicate the balances of each asset per account, as required.
Previously, the command would move all the values into the 0 account.

This will pull fees from the account with the most amount of the staking / fee token.
This differs slightly from iterating through account numbers starting from 0, but is much much simpler.

Issue ticket number and link

Closes #4831.

Checklist before requesting a review

  • If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason:

    Client change only.

This changes the migrate balance command to replicate the balances of
each asset per account, as required.
Previously, the command would move all the values into the 0 account.

This will pull fees from the account with the most amount of the staking
/ fee token.
This differs slightly from iterating through account numbers starting
from 0, but is much much simpler.
@conorsch
Copy link
Contributor

conorsch commented Sep 9, 2024

To test this, I prepared two wallets, one with hefty genesis allocations, and one completely empty. Results are below.

wallet 1, initial balance
❯ cat wallet-1-bal-1.txt
 Account  Amount
 # 0      20000gm
 # 0      500000test_usd
 # 0      989999.994001penumbra
 # 0      20000gn
 # 3      100cube
 # 3      10000pizza
 # 3      10000penumbra
wallet 2, initial balance
❯ cat wallet-2-bal-1.txt
 Account  Amount
wallet 1, post-migration balance
❯ cat wallet-1-bal-2.txt
 Account  Amount
wallet 2, post-migration balance
❯ cat wallet-2-bal-2.txt
 Account  Amount
 # 0      20000gm
 # 0      500000test_usd
 # 0      989999.982219penumbra
 # 0      20000gn
 # 3      100cube
 # 3      10000pizza
 # 3      10000penumbra

Works as advertised: assets were slotted into matching accounts in the dest wallet, and only the staking token had different amounts, due to fees. Coupled with the changes in #4842, this satisfies all spec in #4831.

@conorsch conorsch merged commit 685599d into main Sep 9, 2024
13 checks passed
@conorsch conorsch deleted the 4831-handle-accounts branch September 9, 2024 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pcli: migrate balance function
2 participants